import { resultSuccess } from '../_util'

export default [
  // 创建
  {
    url: '/api/table/item/create',
    timeout: 1000,
    method: 'post',
    response: ({ body }) => {
      const { name = '', tel = '' } = body

      return resultSuccess({
        result: {
          name,
          tel
        }
      })
    },
  },
  // 编辑
  {
    url: '/api/table/item/edit',
    timeout: 1000,
    method: 'patch',
    response: ({ body }) => {
      const { id = '', name = '', tel = '' } = body

      return resultSuccess({
        result: {
          id,
          name,
          tel
        }
      })
    },
  },
]
